package com.ruoyi.common.yyyoupin.bean;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum OrderCancelReason {
    CODE_1403(1403, "客服取消订单"),
    CODE_1404(1404, "已取消_发送报价超时"),
    CODE_1405(1405, "已取消_报价发送失败，系统取消订单"),
    CODE_1406(1406, "已取消_买家取消订单，卖家未发货"),
    CODE_1407(1407, "已取消_确认报价超时"),
    CODE_1409(1409, "已取消_报价被修改"),
    CODE_1410(1410, "已取消_报价在steam超时"),
    CODE_1411(1411, "已取消_报价在Steam令牌取消"),
    CODE_1412(1412, "已取消_拒绝报价"),
    CODE_1413(1413, "已取消_取消报价"),
    CODE_1414(1414, "已取消_商品缺失"),
    CODE_1417(1417, "已取消_支付前取消");

    private final int code;
    private final String message;

    public static String getMessageByCode(int code) {
        for (OrderCancelReason reason : OrderCancelReason.values()) {
            if (reason.getCode() == code) {
                return reason.getMessage();
            }
        }
        return "Invalid code："+code; // Or handle as needed
    }
}
